#{extends 'main.html' /} #{set title:'OrganizationLead' /}
<head>

<script type="text/javascript">
	$(function(userOnPage) {
		$('#unBlockFromOrganizationBtn').hide();
		$('#unBlockReason').hide();
	});

	function BlockFromOrganization(userOnPage, organizationName, userCurrent) {
		BlockFromOrganizationStart(userOnPage, organizationName, userCurrent);
		$('#unBlockFromOrganizationBtn').fadeIn(1000);
		$('#unBlockReason').fadeIn(1000);
		$('#BlockFromOrganizationBtn').fadeOut(1000);
		$('#BlockReason').fadeOut(1000);
	}

	function unBlockFromOrganization(userOnPage, organizationName, userCurrent) {
		unBlockFromOrganizationStart(userOnPage, organizationName, userCurrent);
		$('#unBlockFromOrganizationBtn').fadeOut(1000);
		$('#unBlockReason').fadeOut(1000);
		$('#BlockFromOrganizationBtn').fadeIn(1000);
		$('#BlockReason').fadeIn(1000);
	}
</script>

<script type="application/javascript">
function BlockFromOrganizationStart(userOnPage,organizationName,userCurrent){
	$.getJSON('@{User.blockFromOrganization(userOnPage,organizationName,userCurrent)}',
           {'userOnPage':document.getElementById("BlockFromOrganizationInput1").value,
			'organizationName':document.getElementById("BlockFromOrganizationInput2").value,
			'userCurrent':document.getElementById("BlockFromOrganizationInput3").value,
			'BlockReason':document.getElementById("BlockReason").value},function(data){
				alert(data.result);
    	});
}
</script>

<script type="application/javascript">
function unBlockFromOrganizationStart(userOnPage,organizationName,userCurrent){
	$.getJSON('@{User.blockFromOrganization()}',
           {'userOnPage':document.getElementById("unBlockFromOrganizationInput1").value,
			'organizationName':document.getElementById("unBlockFromOrganizationInput2").value,
			'userCurrent':document.getElementById("unBlockFromOrganizationInput3").value,
			'unBlockReason':document.getElementById("unBlockReason").value},function(data){
				alert(data.result);
    	});
}
</script>

<script type="application/javascript">
function inviteToOrganization(organizationName,userOnPage){
$.getJSON('@{User.inviteIdeaDeveloperToOrganization()}',
           {'userOnPage':document.getElementById("inviteToOrganization1").value,
			'organizationName':document.getElementById("inviteToOrganization2").value},function(data){
				alert(data.result);
    	});
}
</script>

<script type="application/javascript">
function inviteToEntity(userOnPage,entityName){
$.getJSON('@{User.inviteIdeaDeveloperToEntity()}',
           {'userOnPage':document.getElementById("inviteToEntity1").value,
			'entityName':document.getElementById("inviteToEntity2").value},function(data){
				alert(data.result);
    	});
}
</script>

<script type="application/javascript">
function inviteToBeOrg(userOnPage,entityName){
$.getJSON('@{User.invitationToBeOrganizer()}',
           {'userOnPage':document.getElementById("inviteToBeOrg1").value,
			'entityName':document.getElementById("inviteToBeOrg2").value},function(data){
				alert(data.result);
    	});
}
</script>

</head>

<body>
	<div id="content">
		<input type="button" id="BlockFromOrganizationBtn"
			value="Block From Organization" onClick="BlockFromOrganization()">
		<input id="BlockFromOrganizationInput1" type="hidden"
			value="${userOnPage}" /> <input id="BlockFromOrganizationInput2"
			type="hidden" value="${organizationName}" /> <input
			id="BlockFromOrganizationInput3" type="hidden" value="${userCurrent}" />
		<input id="BlockReason" type="text" /> <br /> <input type="button"
			id="unBlockFromOrganizationBtn" value="unBlock From Organization"
			onClick="unBlockFromOrganization()"> <input
			id="unBlockFromOrganizationInput1" type="hidden"
			value="${userOnPage}" /> <input id="unBlockFromOrganizationInput2"
			type="hidden" value="${organizationName}" /> <input
			id="unBlockFromOrganizationInput3" type="hidden"
			value="${userCurrent}" /> <input id="unBlockReason" type="text" />
		<br /> <input type="button" id="inviteToOrganization"
			value="Invite to Organization" onClick="inviteToOrganization()">
		<input id="inviteToOrganization1" type="hidden" value="${userOnPage}" />
		<input id="inviteToOrganization2" type="hidden"
			value="${organizationName}" /> <br /> <input type="button"
			id="inviteToEntity" value="invite to Entity"
			onClick="inviteToEntity()"> <input id="inviteToEntity1"
			type="hidden" value="${userOnPage}" /> <input id="inviteToEntity2"
			type="hidden" value="${entityName}" /> <br /> <input type="button"
			id="inviteToBeOrg" value="invite To Be Organizer"
			onClick="inviteToBeOrg()"> <input id="inviteToBeOrg1"
			type="hidden" value="${userOnPage}" /> <input id="inviteToBeOrg2"
			type="hidden" value="${entityName}" />
	</div>
	<div id="sidebar"></div>
</body>
